<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="order/include :: header"></head>

<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<div class="form-horizontal m-t" id="signupForm">
							<input type="hidden" th:value="${order.id}" id="id" name="id">
							<table class="table table-bordered table-condensed">
								<tbody>
								<tr>
									<th class="required" >下单人姓名:</th>
									<td th:text="${order.nickname}"></td>

									<th class="required" >联系电话:</th>
									<td th:text="${order.mobile}"></td>
								</tr>
								<tr>
									<th class="required" >订单号:</th>
									<td th:text="${order.ordersn}"></td>
								</tr>


								<tr>
									<th class="required" >省市区:</th>
									<td th:text="${order.province} + '-'+ ${order.city}+ '-'+ ${order.district}"></td>
									
									<th class="required" >详细地址:</th>
									<td th:text="${order.address}"></td>
								</tr>

								<tr>
									<th class="required" >商品小计</th>
									<td th:text="${order.goodsprice}"></td>
								</tr>
								<tr>
									<th class="required" >需要支付:</th>
									<td th:text="${order.payprice}"></td>

									<th class="required" >下单时间:</th>
									<td th:text="${order.createTime} == null?null:${#dates.format(order.createTime,'yyyy-MM-dd HH:mm:ss')}"></td>
								</tr>
								<tr>
									<th class="required" >订单状态:</th>
									<td th:text="${order.statusName}"></td>

									<th class="required" >支付时间:</th>
									<td th:text="${order.payTime} == null?null:${#dates.format(order.payTime,'yyyy-MM-dd HH:mm:ss')}"></td>
								</tr>
								<tr>
									<th class="required" >支付单号:</th>
									<td th:text="${order.payno}"></td>

									<th class="required" >商户单号:</th>
									<td th:text="${order.payMerchantNo}"></td>
								</tr>
								<tr>
									<th >备注:</th>
									<td colspan="3">
										<textarea th:text="${order.remark}" class="form-control" onblur="saveRemark()" id="remark"></textarea>
									</td>
								</tr>
								</tbody>
							</table>
						</div>

						<div class="ibox-title">
							<h5>订单清单</h5>
						</div>
						<div class="form-horizontal m-t">
							<table class="table table-bordered table-condensed">
								<thead>
									<tr>
										<th>名称</th>
										<th>规格</th>
										<th>数量</th>
										<th>单品单价</th>
										<th>总价</th>
										<th>单品佣金*份数</th>
										<th>佣金</th>
										<th>清单状态</th>
									</tr>
								</thead>
								<tbody>
								<tr th:each="item:${order.orderProducts}">
									<td th:text="${item.productName}"></td>
									<td th:text="${item.optionname}"></td>
									<td th:text="${item.total}"></td>
									<td th:text="${item.marketprice}"></td>
									<td th:text="${item.price}"></td>
									<td th:text="${item.headcommission}+'*'+${item.total}+'份'"></td>
									<td th:text="${item.commision1}"></td>
									<td th:text="${item.iscreate} == '1'?'已生成':'未生成'"></td>
								</tr>
								</tbody>
							</table>
							<table>

							</table>
							<div class="form-group text-center">
								<div class="col-sm-8 col-sm-offset-2">
									<div class="btn btn-danger" onclick="closeDow()"><i class="fa fa-remove"></i> 关闭</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>
	<div th:include="order/include::footer"></div>
	<script type="text/javascript">
		function closeDow() {
			var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
			parent.layer.close(index);
		}

		function saveRemark() {
			$.ajax({
				url: "/order/manage" + "/update",
				type: "POST",
				data: {
					id: $('#id').val(),
					remark:$('#remark').val()
				},
				success: function (r) {
					parent.layer.msg(r.msg);
				}
			});
		}
	</script>
</body>
</html>
